-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use -Xnojline option when starting console #468
Conversation
Since we are using Nailgun, the REPL is being run in a different process than the one connected to the user's terminal, so we cannot run Scala's ILoop with InteractiveReader - we must use SimpleReader instead. By passing -Xnojline argument to AnalyzingCompiler.console we make sure that it will use SimpleReader. Fixes scalacenter#385.
@@ -212,7 +212,8 @@ object Tasks { | |||
val loader = ClasspathUtilities.makeLoader(classpathFiles, scalaInstance) | |||
val compiler = state.compilerCache.get(scalaInstance).scalac.asInstanceOf[AnalyzingCompiler] | |||
val classpathOptions = ClasspathOptionsUtil.repl | |||
compiler.console(classpathFiles, project.scalacOptions, classpathOptions, "", "", state.logger)( | |||
val options = project.scalacOptions :+ "-Xnojline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to use a constant here, but scala.tools.nsc.settings.ScalaSettings
has no companion object and I don't think that creating our own instance just to extract this value makes much sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag is unlikely to change, so I don't think it's a big deal 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a pity this didn't make it into M10! This change looks great, I'm so happy to see the console working again.
@@ -212,7 +212,8 @@ object Tasks { | |||
val loader = ClasspathUtilities.makeLoader(classpathFiles, scalaInstance) | |||
val compiler = state.compilerCache.get(scalaInstance).scalac.asInstanceOf[AnalyzingCompiler] | |||
val classpathOptions = ClasspathOptionsUtil.repl | |||
compiler.console(classpathFiles, project.scalacOptions, classpathOptions, "", "", state.logger)( | |||
val options = project.scalacOptions :+ "-Xnojline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag is unlikely to change, so I don't think it's a big deal 👍
By the way, I just realized that we should handle cancellation for the console gracefully and filed #469. |
Since we are using Nailgun, the REPL is being run in a different
process than the one connected to the user's terminal, so we cannot
run Scala's ILoop with InteractiveReader - we must use SimpleReader
instead. By passing -Xnojline argument to AnalyzingCompiler.console we
make sure that it will use SimpleReader.
Fixes #385.